﻿namespace WMS6.Web.TaskMgmt
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class TaskQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlBeginTime;
        protected DropDownList ddlDocID;
        protected DropDownList ddlDocLineID;
        protected DropDownList ddlEndTime;
        protected DropDownList ddlFromLoc;
        protected DropDownList ddlFromLpnID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlPriority;
        protected DropDownList ddlQty;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlTaskDetailID;
        protected DropDownList ddlTaskTypeOper;
        protected DropDownList ddlToLoc;
        protected DropDownList ddlToLpnID;
        protected DropDownList ddlUserID;
        protected HtmlForm form1;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img1;
        protected HtmlImage img2;
        protected HtmlImage img3;
        protected HtmlImage imgEndTime;
        protected Label lblBeginTime;
        protected Label lblDocID;
        protected Label lblDocLineID;
        protected Label lblEndTime;
        protected Label lblFromLoc;
        protected Label lblFromLpnID;
        protected Label lblOwnerID;
        protected Label lblPriority;
        protected Label lblQty;
        protected Label lblReceiptQuery;
        protected Label lblSkuID;
        protected Label lblTaskDetailID;
        protected Label lblTaskType;
        protected Label lblToLoc;
        protected Label lblToLpnID;
        protected Label lblUserID;
        protected MultipleSelectControl MSCTaskType;
        protected HtmlLink mycss;
        protected TextBox txtBeginTime;
        protected TextBox txtBeginTime2;
        protected TextBox txtDocID;
        protected TextBox txtDocLineID;
        protected TextBox txtEndTime;
        protected TextBox txtEndTime2;
        protected TextBox txtFromLoc;
        protected TextBox txtFromLpnID;
        protected TextBox txtOwnerID;
        protected TextBox txtPriority;
        protected TextBox txtQty;
        protected TextBox txtSkuID;
        protected TextBox txtTaskDetailID;
        protected TextBox txtToLoc;
        protected TextBox txtToLpnID;
        protected TextBox txtUserID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("TaskList.aspx", false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlBeginTime, 1);
            base.InitQueryDDL(this.ddlEndTime, 1);
            base.InitQueryDDL(this.ddlFromLoc, 0);
            base.InitQueryDDL(this.ddlFromLpnID, 0);
            base.InitQueryDDL(this.ddlPriority, 0);
            base.InitQueryDDL(this.ddlQty, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlTaskDetailID, 0);
            base.InitQueryDDL(this.ddlTaskTypeOper, 0);
            base.InitQueryDDL(this.ddlDocID, 0);
            base.InitQueryDDL(this.ddlDocLineID, 0);
            base.InitQueryDDL(this.ddlToLoc, 0);
            base.InitQueryDDL(this.ddlToLpnID, 0);
            base.InitQueryDDL(this.ddlUserID, 0);
            base.BindData2DDLBySysCode(this.MSCTaskType, "TaskType");
            this.ddlTaskTypeOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string BeginTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBeginTime.Text.Trim()))
                {
                    return base.GetParamsString(this.txtBeginTime.Text.Trim(), this.ddlBeginTime.SelectedValue, this.txtBeginTime2.Text.Trim(), "BeginTime");
                }
                return "";
            }
        }

        public string DocID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtDocID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtDocID.Text.Trim(), this.ddlDocID.SelectedValue);
                }
                return "";
            }
        }

        public string DocLineID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtDocLineID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtDocLineID.Text.Trim(), this.ddlDocLineID.SelectedValue);
                }
                return "";
            }
        }

        public string EndTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
                {
                    return base.GetParamsString(this.txtEndTime.Text.Trim(), this.ddlEndTime.SelectedValue, this.txtEndTime2.Text.Trim(), "EndTime");
                }
                return "";
            }
        }

        public string FromLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromLoc.Text.Trim(), this.ddlFromLoc.SelectedValue);
                }
                return "";
            }
        }

        public string FromLpnID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromLpnID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromLpnID.Text.Trim(), this.ddlFromLpnID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string Priority
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPriority.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPriority.Text.Trim(), this.ddlPriority.SelectedValue);
                }
                return "";
            }
        }

        public string Qty
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtQty.Text.Trim()))
                {
                    return base.GetParamsString(this.txtQty.Text.Trim(), this.ddlQty.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string TaskDetailID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtTaskDetailID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtTaskDetailID.Text.Trim(), this.ddlTaskDetailID.SelectedValue);
                }
                return "";
            }
        }

        public string TaskType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCTaskType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCTaskType.ReturnValue, this.ddlTaskTypeOper.SelectedValue);
                }
                return "";
            }
        }

        public string ToLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToLoc.Text.Trim(), this.ddlToLoc.SelectedValue);
                }
                return "";
            }
        }

        public string ToLpnID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToLpnID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToLpnID.Text.Trim(), this.ddlToLpnID.SelectedValue);
                }
                return "";
            }
        }

        public string UserID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtUserID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtUserID.Text.Trim(), this.ddlUserID.SelectedValue);
                }
                return "";
            }
        }
    }
}

